package formBean;

import java.util.ArrayList;
import java.util.List;

import org.mybeans.form.FormBean;

public class GetListForm extends FormBean{

	private String username;

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}
	
	public List<String> getValidationErrors(){
		List<String> errors = new ArrayList<String>();
		if(username == null || username.length() < 1){
			errors.add("Can't delete this URL");
		}else{
			if(username.contains("<") || username.contains(">") || username.contains("'") || username.contains("\"") || username.contains("\\") || username.contains("/")){
				errors.add("Invalid URL to delete");
			}
		}
		return errors;
	}
}
